The disclosures of the following priority applications are herein incorporated by reference:
Japanese Patent Application No. 11-328379 filed Nov. 18, 1999
Japanese Patent Application No. 11-328380 filed Nov. 18, 1999
Japanese Patent Application No. 11-328381 filed Nov. 18, 1999
1. Field of the Invention
The present invention relates to an image data compression method, an image data compression apparatus and a recording medium and data signal for providing image data compression program.
2. Description of the Related Art
With further technological development achieved in the area of image input devices (e.g., CCDs employed in digital cameras), image data are taken in at increasingly high definition. The user performs image processing by using a personal computer or the like on raw data (original data) that have been obtained with such a high degree of resolution and gradation, and then desired image data are achieved through an output device (e.g., a CRT, a printer).
Image data that are represented as signals (signal charges) from a CCD are converted by an A/D converter to digital signals having, for instance, 10xcx9c12 bits per pixel. When the image data are converted to 12-bit digital signals, each corresponding to 12 bits, the maximum number of gradation levels is 4096. The image data taken in at high definition in units of 10xcx9c12 bits in this manner are converted to image data of approximately 8 bits per pixel and the image is reproduced at an output device.
The number of bits of image data corresponding to one pixel at the time of the data intake is 10xcx9c12, as described above, since the photographing environment can change significantly during the data intake from an extremely bright field to a extremely dark field, and since it is necessary to obtain image data evenly over this wide photographing environment range. However, since the lightness difference that is actually represented within a given frame (image plane) at the time of reproduction is smaller than that in the photographing environment, the contrast of the image in the frame can be expressed by 8-bit image data in a satisfactory manner.
The image data taken in by a CCD are stored in a storage medium and the image data are read out as necessary from the storage medium. In the prior art, image data achieved through conversion to 8-bit image data are stored in the storage medium. Since the data volume corresponding to a single frame (a single image plane) becomes huge when 8-bit image data are stored directly, the image data undergo compression processing before they are stored in the storage medium.
Types of image data compression processing that are normally implemented include DPCM processing, Huffman coding and arithmetic coding that are performed on raw data, JPEG lossless coding achieved by utilizing the forgoing methods in appropriate combination and universal coding, a typical example of which is the Ziv-Lempel method.
However, if image data having 8 bits per pixel are stored as original data at the storage medium, the image data that are obtained after the user performs desired processing/modification on the 8-bit image data will have 8 bits or fewer per pixel to result in a relatively poor image quality.
As a solution, the image quality of image data having undergone processing/modification can be improved by directly storing in the storage medium the raw data of an image achieving a high degree of gradation levels (10xcx9c12 bits) obtained by the CCD, reading out the raw data and performing the processing/modification on them.
While it is also necessary to perform the compression processing (in particular, reversible compression processing) when storing raw data achieving such a high degree of gradation levels in the storage medium, there is a problem in that a high compression rate cannot be achieved by performing compression processing on 10xcx9c12-bit image data similar to the compression processing performed on 8-bit image data.
An object of the present invention is to provide an image data compression method and an image data compression apparatus that enable compression of image data that have been obtained at high gradation levels while achieving a high compression rate, and also to provide a recording medium and a data signal providing an image data compression program executing such functions.
In order to attain the above object, an image data compression method according to the present invention for compressing image data including pixel data having a specific number of bits per pixel obtained at an image input device, comprises: a step in which the pixel data having the specific number of bits are divided into higher-order bit data having a first number of bits and lower-order bit data having a second number of bits; and a step in which at least the higher-order bit data resulting from division are compressed through a specific compression method.
This image data compression method preferably further comprises: a step in which the higher-order bit data that have been compressed are stored in a first storage area; a step in which the lower-order bit data are stored in a second storage area through a specific method; and a step in which first positional data provided for management of a storage position of the higher-order bit data and second positional data provided for management of a storage position of the lower-order bit data are stored in a third storage area.
Also the image data compression method preferably further comprises: a step in which the higher-order bit data that have been compressed are stored in a first storage area; and a step in which the lower-order bit data are stored in a second storage area through a specific method. In this case, data corresponding to a third number of bits starting from a highest order bit that is set in the pixel data are valid data; and bits in the lower-order bit data that are not included in the valid data are not stored in the second storage area.
Also in the image data compression method, preferably, the image input device is provided with color filters having specific colors in correspondence to individual pixels. In this case, the compression method employed to compress the higher-order bit data preferably comprises: a step in which the individual pixels are each sequentially assigned as a target pixel; a step in which a predicted value for the target pixel is calculated based upon pixel data corresponding to one or more nearby pixels including, at least, a pixel having a color filter with the same color component as the target pixel that has already been obtained; a step in which an error in the predicted value that has been calculated relative to pixel data corresponding to the target pixel obtained by the image input device is ascertained; and a step in which the error that has been calculated is coded through a specific method.
Another image data compression method for compressing image data obtained by an image input device provided with color filters in specific colors corresponding to individual pixels, comprises: a step in which the individual pixels are each sequentially assigned as a target pixel; a step in which a predicted value for the target pixel is calculated based upon pixel data corresponding to one or more nearby pixels including, at least, a pixel having a color filter with the same color component as the target pixel; a step in which an error in the predicted value that has been calculated relative to pixel data corresponding to the target pixel obtained by the image input device is ascertained; and a step in which the error that has been calculated is coded through a specific method.
In this image data compression method, preferably, a plurality of prediction formulae are provided to calculate the predicted value for the target pixel and are selectively used in conformance to a specific positional relationship between the target pixel and a nearby pixel; and a prediction formula that has achieved a closest predicted value to pixel data actually acquired in a nearby pixel, which is provided with color filter having the same color component as the target pixel and has been processed before the target pixel, is used to calculate the predicted value for the target pixel.
The above image data compression method preferably further comprises: a step in which the error that has been ascertained is quantized using a quantization table, that is implemented after the step in which the error is ascertained. In this case, the error that has been quantized is coded through a specific method in the step in which the error is coded.
Another image data compression method for compressing image data, which is obtained by an image input device, having a specific number of bits per pixel, comprises: a step in which data corresponding to each pixel having the specific number of bits are divided into higher-order bit data having a specific number of higher-order bits and lower-order bit data having a specific number of lower-order bits; a step in which the higher-order bit data undergo variable-length coding; a step in which the lower-order bit data are packed through a bit-shift operation performed on a plurality of pixels; a step in which management data to be used to individually manage the higher-order bit data having undergone the variable-length coding and the lower-order bit data that have been packed are generated; and a step in which the higher-order bit data having undergone the variable-length coding, the lower-order bit data that have been packed and the management data that have been generated are recorded in a recording medium.
In this image data compression method, preferably, the image input device has pixels arrayed in a matrix; the higher-order bit data having undergone the variable-length coding are grouped together in blocks each corresponding to units of pixels included in a row; the lower-order bit data that have been packed are grouped together in blocks each corresponding to units of pixels included in a row; and positional information indicating individual recording positions of the higher-order bit data that have been grouped together in blocks and the lower-order bit data that have been grouped together in blocks is generated as the management data.
Also, preferably, the variable-length coding is achieved through a combination of Huffman coding and DPCM coding.
Also, preferably, the specific number of bits in the data representing each pixel is a value corresponding to a degree of accuracy of detection achieved at the image input device; and the specific number of higher-order bits, at which correlation with nearby pixels tends to manifest greatly, is determined through rules of experience.
An image data management method for managing image data, which is obtained by an image input device provided with pixels arrayed in a matrix, having a specific number of bits per pixel, comprises: a step in which data corresponding to each pixel having the specific number of bits are divided into higher-order bit data having a specific number of higher-order bits and lower-order bit data having a specific number of lower-order bits; a step in which the higher-order bit data are grouped together in blocks in units of pixels included in a row; step in which lower-order bit data are grouped together in blocks in units of pixels included in a row; a step in which positional information indicating individual recording positions of the higher-order bit data that have been grouped together in blocks and the lower-order bit data that have been grouped together in blocks is generated; and a step in which the higher-order bit data that have been grouped together in blocks, the lower-order bit data that have been grouped together in blocks and the positional information that has been generated are recorded in the recording medium.
Another image data compression method for compressing image data, which is obtained by an image input device, having a specific number of bits per pixel, comprising: a step in which raw data corresponding to each pixel having the specific number of bits are divided into higher-order bit data having a specific number of higher-order bits and lower-order bit data having a specific number of lower-order bits; a step in which the higher-order bit data undergo reversible coding; a step in which a number of valid bits in the lower-order bit data is determined based upon the raw data corresponding to each pixel having the specific number of bits per pixel; a step in which higher-order data corresponding to specific bits in the lower-order bit data are extracted in conformance to a width representing the number of valid bits; a step in which management data to be used to individually manage the higher-order bit data having undergone the reversible coding and the lower-order bit data corresponding to the width representing the number of valid bits that have been extracted are generated; and a step in which the higher-order bit data having undergone the reversible coding, the lower-order bit data corresponding to the width representing the number of valid bits that have been extracted and the management data that have been generated are recorded in the recording medium.
In this image data compression method, preferably, the number of valid bits is determined in conformance to a valid bit width in the raw data corresponding to each pixel.
Also, preferably, the valid bit width of each pixel is a value corresponding to a degree of accuracy of detection achieved at the image input device; and the specific number of the higher-order bits at which correlation with nearby pixels tends to manifest greatly, is determined through rules of experience.
Another image data compression method for compressing image data obtained in units of individual pixels by a single-board CCD provided with color filters arrayed in a specific pattern, comprises: a step in which the individual pixels are each sequentially assigned as a target pixel; a step in which a predicted value for the target pixel is calculated based upon a pixel value that has already been obtained for a nearby pixel having a color filter with the same color component as the target pixel; a step in which an error in the predicted value that has been calculated and a pixel value corresponding to the target pixel obtained by the single-board CCD is ascertained; and a step in which the error that has been calculated is coded.
Another image data compression method for compressing image data obtained in units of individual pixels by a single-board CCD provided with color filters arrayed in a specific pattern, comprises: a step in which the individual pixels are each sequentially assigned as a target pixel; a step in which a predicted value for the target pixel is calculated based upon a pixel value of a nearby pixel that has already been obtained; a step in which an error in the predicted value that has been calculated with respect to pixel data corresponding to the target pixel obtained by the single-board CCD is ascertained; a step in which the error thus ascertained is coded; a step in which a predicted value is calculated by using a pixel value of an adjacent pixel provided with a color filter having a color component different from the color component at the target pixel as the pixel value of the nearby pixel; a step in which a predicted value is calculated by using a pixel value of a same-color pixel provided with a color filter having the same color component as the target pixel as the pixel value of the nearby pixel; a step in which a decision is made as to which predicted value a pixel value of the target pixel obtained by the single-board CCD is closest to; and a step in which a decision is made as to whether the pixel value of an adjacent pixel or a same-color pixel is to be used to calculate a predicted value of a next target pixel based upon result of the decision in the previous step.
An image data compression apparatus according to the present invention carries out the image data compression method or the image data management method described above.
A recording medium according to the present invention records therein an image data compression program that carries out the image data compression method or the image data management method described above.
A data signal according to the present invention embodied in a carrier wave comprises an image data compression program that carries out the image data compression method or the image data management method described above.